<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui">
<ui:composition template="../templates/template.xhtml">
	<ui:define name="title">
		<h:outputText value="#{msg.reino_title}" />
	</ui:define>
	<ui:define name="context">
		<h:form>
			<h:panelGrid columns="2">
				<p:commandButton value="#{msg.reino_add}" oncomplete="dlg.show();"
					update="formCad" />
				<p:commandButton value="#{msg.button_list}" ajax="false"
					action="#{reinoMB.list}" update="listPanel" />
				<p:inputText value="#{reinoMB.busca}" />
				<p:commandButton value="#{msg.button_search}" ajax="false"
					action="#{reinoMB.find}" />
			</h:panelGrid>
			<p:dataTable rendered="#{reinoMB.listing}"
				value="#{reinoMB.listEntity}" var="reinos" rows="5"
				emptyMessage="#{msg.reino_empty}" paginator="true">
				<p:column headerText="#{msg.reino_reinoColumn}">
					<h:outputText value="#{reinos.reino}" />
				</p:column>
				<p:column headerText="#{msg.column_edit}">
					<p:commandLink update="formCad" oncomplete="dlg.show();">
						<f:setPropertyActionListener target="#{reinoMB.entity}"
							value="#{reinos}" />
						<p:graphicImage
							value="#{pageContext.servletContext.contextPath}/images/editar.png"
							title="#{msg.column_edit}" />
					</p:commandLink>
				</p:column>
				<p:column headerText="#{msg.column_delete}">
					<p:commandLink action="#{reinoMB.delete}" ajax="false">
						<p:graphicImage
							value="#{pageContext.servletContext.contextPath}/images/lixeira.png"
							title="#{msg.column_delete}" />
						<f:setPropertyActionListener target="#{reinoMB.entity}"
							value="#{reinos}" />
					</p:commandLink>
				</p:column>
			</p:dataTable>
			<p:messages showDetail="true" showSummary="false" />
		</h:form>
		<p:dialog widgetVar="dlg" modal="true" closable="true"
			header="#{msg.reino_header}">
			<h:form id="formCad">
				<h:panelGrid columns="2">
					<h:outputText value="#{msg.reino_reino}" />
					<p:inputText value="#{reinoMB.entity.reino}" />
				</h:panelGrid>
				<p:column>
					<p:commandButton value="#{msg.button_save}"
						action="#{reinoMB.saveOrUpdate}" ajax="false" />
					<p:commandButton value="#{msg.button_cancel}" onclick="dlg.hide();"
						actionListener="#{reinoMB.cancel}" />
				</p:column>
			</h:form>
		</p:dialog>
	</ui:define>
</ui:composition>
</html>

